package com.vincent.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vincent.entity.Role;
import com.vincent.entity.UserRole;
import com.vincent.mapper.UserRoleMapper;
import com.vincent.service.IUserRoleService;
import org.springframework.stereotype.Service;



@Service
public class UserRoleService extends ServiceImpl<UserRoleMapper, UserRole> implements IUserRoleService {
    @Override
    public UserRole byUserId(Integer userId) {
        QueryWrapper<UserRole> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id",userId);
        return this.baseMapper.selectOne(wrapper);
    }
}
